Run Script
AutomatR.DefaultActivities.Python.RunScript
The "Run Script" activity in AutomatR enables the execution of a Python script using a specified Python interpreter. This versatile activity allows you to integrate Python scripts seamlessly into your automation workflows.
Properties
Name | Description |
---|---|
Input | |
Enter Method Parameters | Enter the parameters/arguments in the code file as an Enumerable object list up to 9. The path should be specified as follows: Example - D:/abc/xyz/. Enumerable object containing the parameters for the Python script. |
Python File | Specifies the Python path with the script file to be executed. String variables containing the path to the Python script file. |
Python Path | Specifies the full path of the Python interpreter to be used for executing the script. String variables containing the path to the Python interpreter. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Run Script" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 5 seconds, enter 5. |
Output | |
Result | Returns the output of the Python script execution as a string. String variables containing the result of the Python script execution. |
How to use:
- Drag and drop the "Run Script" activity onto the workflow.
- Configure the properties by specifying the full path of the Python interpreter, the parameters for the Python script, and the path to the Python script file.
- Optionally, set the delay for the execution.
- Execute the workflow to run the specified Python script.
- The output of the Python script execution is stored in the variable specified in the "Result" property.
Example:
Consider an example where the "Run Script" activity is used to execute a Python script that processes input files and generates output images:
Run Script:
Display Name: "Process Input Files"
Python Path: "C:/Python38/python.exe"
Arguments: ["D:/InputFiles/", "D:/OutputImages/", "param3", ..., "param8"]
Python File: "C:/Scripts/ProcessFiles.py"
Result: scriptOutput
In this example, the activity executes the Python script located at "C:/Scripts/ProcessFiles.py" using the Python interpreter at "C:/Python38/python.exe". The input parameters for the script are specified in the "Arguments" property, and the output of the script is stored in the variable "scriptOutput" for further use in the workflow.